// settings.js - 应用设置状态管理模块

export default {
  namespaced: true,
  state: {
    theme: 'light',
    language: 'zh-CN',
    notifications: true
  },
  getters: {
    currentTheme: state => state.theme,
    currentLanguage: state => state.language,
    notificationsEnabled: state => state.notifications
  },
  mutations: {
    SET_THEME(state, theme) {
      state.theme = theme;
    },
    SET_LANGUAGE(state, language) {
      state.language = language;
    },
    TOGGLE_NOTIFICATIONS(state) {
      state.notifications = !state.notifications;
    }
  },
  actions: {
    updateTheme({ commit }, theme) {
      // 可以在这里添加主题更新相关逻辑
      commit('SET_THEME', theme);
    },
    updateLanguage({ commit }, language) {
      // 可以在这里添加语言更新相关逻辑
      commit('SET_LANGUAGE', language);
    },
    toggleNotifications({ commit }) {
      commit('TOGGLE_NOTIFICATIONS');
    }
  }
};
